package com.corpgovernment.common.operatelog.enums;

/**
 * @ClassName: PayConfigEnum
 * @description: TODO
 * @author: jiang.luo
 * @date: Created in 19:09 2020/1/6
 * @Version: 1.0
 **/

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 支付类型枚举 统一/个人
 */
public enum PayConfigEnum {
    PPAY("PPAY","个人支付"),
    ACCNT("ACCNT","统一支付");


    /**
     * 描述
     */
    private String desc;

    /**
     * code
     */
    private String code;


    private PayConfigEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static final Map<String, PayConfigEnum> lookup = new HashMap<>();

    static {
        for (PayConfigEnum s : EnumSet.allOf(PayConfigEnum.class)) {
            lookup.put(s.getCode(), s);
        }
    }

    public String getDesc() {
        return desc;
    }

    public String getCode() {
        return code;
    }

    public static PayConfigEnum get(String code) {
        return lookup.get(code);
    }
    public static boolean exists(String code) {
        return lookup.containsKey(code);
    }
}
